<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然金融中心管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">
        <!-- 当前位置 begin -->
        <div class="row h-home-path">
          <div class="col-md-12">
            <ol class="breadcrumb">
              <li><i class="fa fa-home"></i>&nbsp;&nbsp;所在位置</li>
              <li><a href="#">首页</a></li>
              <li class="active">登录页面</li>
            </ol>
          </div>
        </div>
        <!-- 当前位置 end -->
        <!-- login begin -->
        <div align="center" id="login-panel" style="width:80%">
          <!-- panel content -->
          <div class="panel panel-primary" id="login-form" id="panel-content">
            <form action="" class="form-condensed" method="post" target="hidenwin">
              <table class="table table-form" style="width:400px">
                <tbody>
                <tr>
                  <td class="text-center" colspan="2">浩然金融中心管理系统</td>
                </tr>
                <tr>
                  <th class="text-right">用户名：</th>
                  <td>
                    <div class="form-group">
                      <input class="form-control col-sm-2" id="userName" name="userName" type="text"/>
                    </div>
                  </td>
                </tr>
                <tr>
                  <th class="text-right">密码：</th>
                  <td>
                    <div class="form-group">
                      <input class="form-control col-sm-2" id="password" name="password" type="password"/>
                      <a href="/login/rebackPassword" target="_blank">忘记密码？</a>
                    </div>
                  </td>
                </tr>
                <tr>
                  <th class="text-right">验证码：</th>
                  <td>
                    <input class="form-control col-sm-2" id="verifyCode" name="verifyCode" onblur="checkImageCode()"
                           type="text"/>
                    <img alt="" id="imgObj" src="/login/verifyCode"/>
                    <a href="#" onclick="changeImg()">换一张</a>
                    <div id="info"></div>
                  </td>
                </tr>
                <tr>
                  <th></th>
                  <td id="keeploginTd">
                    <label class="checkbox-inline">
                      <input id="keepLogin" name="keepLogin" type="checkbox" value="on"/>
                      保持登录
                    </label>
                  </td>
                </tr>
                <tr>
                  <th></th>
                  <td>
                    <button class="btn btn-primary" id="submitBtn" name="submitBtn" type="submit">登录</button>
                    <button class="btn btn-primary" id="registerBtn" name="registerBtn" type="button">注册</button>
                  </td>
                </tr>
                </tbody>
              </table>
            </form>
          </div>
          <div class="panel-foot" id="panel-foot">
            <span>友情链接</span>
            <a>中国银行</a>
            <a>中国建设银行</a>
          </div>
        </div>
        <!-- login end -->
      </div>
    </div>
  </div>
</div>
<#include "/common/jslib.html">
<script type="text/javascript">
    $(function () {
        DemoManager = {
            init: function () {
            }
        }
        DemoManager.init();
    });
</script>
<script type="text/javascript">
    function changeImg() {
        var imgSrc = $("#imgObj");
        var src = imgSrc.attr("src");
        imgSrc.attr("src", chgUrl(src));
    }

    //时间戳
    //为了使每次生成图片不一致，即不让浏览器读缓存，所以需要加上时间戳
    function chgUrl(url) {
        var timestamp = (new Date()).valueOf();
        url = url + "?timestamp=" + timestamp;
        return url;
    }

    function checkImageCode() {
        var imageCode = $("#verifyCode").val();
        if (imageCode == null || imageCode == '') {
            return;
        }
        var data = {
            imageCode: imageCode
        }
        var url = "/login/validateCode";
        Jmts.ajaxPost(url, data, function (result) {
            var flag = result.flag;
            if (result.success) {
                $("#info").css("color", "green");
                $("#info").html(result.msg);
            } else {
                $("#info").css("color", "red");
            }
        });
    }
</script>
</body>
</html>
